//读一点 写一点
const fs = require('fs')
const SIZE = 3
function copy(src, target) {
    fs.open(src, 'r', 0o666, function (err, readFd) {
        fs.open(target, 'w', 0o666, (err, writeFd) => {
            let buff = Buffer.alloc(SIZE)
            !function next() {
                fs.read(readFd, buff, 0, SIZE, null, (err, bytesRead, buffer) => {
                    if(bytesRead>0) fs.write(writeFd,buff,0,SIZE,next)
                })
            }()
        })
    })
}
copy('1.txt', '3.txt')
copy('2.txt', '3.txt')